window.onload=function()
{
	var Message_Form=$('Message_Form');
	Message_Form.name.focus();
	Message_Form.action='${contextPath }/message.do?operation=add';
	Message_Form.onsubmit=function()
	{
		if(Message_Form.name.value=='')
		{
			alert('请填写姓名!');
			Message_Form.name.focus();
			return false;
		};
		if(Message_Form.phone.value=='')
		{
			alert('请填写联系号码!');
			Message_Form.phone.focus();
			return false;
		};
		if(Message_Form.name.value=='')
		{
			alert('请填写QQ号码!');
			Message_Form.name.focus();
			return false;
		};
		if(Message_Form.title.value=='')
		{
			alert('请填写留言主题!');
			Message_Form.title.focus();
			return false;
		};
		if(Message_Form.content.value=='')
		{
			alert('请填写留言内容!');
			Message_Form.Content.focus();
			return false;
		};	
		if(Message_Form.valCode.value=='')
		{
			alert('请填写验证码!');
			Message_Form.valCode.focus();
			return false;
		}
		else
		{
			if(Regexper.valCode.test(Message_Form.valCode.value)==false)
			{
				alert('请填写正确的验证码!');
				Message_Form.valCode.value='';
				Message_Form.valCode.focus();
				return false;			
			}			
		};
		Message_Form.submit();
	};
};